import React,{Component,Fragment} from 'react';
import {Router,Route, Redirect,Switch} from 'react-router-dom';
import createHistory  from 'history/createBrowserHistory';


import routerConfig from './router';
import './main.less'


const histroy = createHistory({
})

export default  class App extends Component{

    render(){
        return (
        <div className="main">
            <Router history={histroy}>
                <Fragment>
                    <Switch>
                        {routerConfig.map(rt=>(
                            <Route path={rt.path} key={rt.path} component = {rt.component} />
                        ))}
                        <Redirect  to="/home"/>
                    </Switch>
                </Fragment>
            </Router>
        </div>
        )
    }
}


